#ifndef S8000_H
#define S8000_H
#include <io/iousb.h>

// for a8/a9 exploit
// eclipsa: https://github.com/0x7ff/eclipsa
// sigcheck patch: https://github.com/hack-different/ipwndfu/blob/main/docs/sigcheck_patches.txt
typedef struct {
    bool hasHeapSpray;
    unsigned int pushVal;
    uint64_t loadaddr;
    size_t overwrite_size;
    size_t overwrite_off;
    int resetFlag;
    // offsets for exploit
    uint64_t SYNOPSYS_ROUTINE_ADDR;
    uint64_t IO_BUFFER_ADDR;
    uint64_t VROM_PAGE_TABLE_ADDR;
    uint64_t ARCH_TASK_TRAMP_ADDR;
    uint64_t gUSBSerialNumber;
    uint64_t gUSBSRNMStringDescriptor;
    uint64_t gUSBDescriptors;
    uint64_t usb_create_string_descriptor;
    uint64_t gDemotionRegister;
    uint64_t PATCH_ADDR; // Universal sigcheck patch
} exploit_t;

int checkm8_s8000(io_client_t client, bool eclipsaStyle);

#endif
